//
//  TMTheme.swift
//  ThemeManagement
//
//  Created by fanxiaoxin_1987@126.com on 06/20/2022.
//  Copyright (c) 2022 fanxiaoxin_1987@126.com. All rights reserved.
//

import UIKit

/// 代表主题
public indirect enum TMTheme: Hashable, RawRepresentable {
    /// 默认值，可当做默认主题，若是默认值不一定跟着默认主题走则可只将该主题作为默认值储存标记，不要切换到该主题即可
    case `default`
    case name(String)
    
    public typealias RawValue = String
    public init(rawValue: String) {
        if rawValue == "default" {
            self = .default
        } else {
            self = .name(rawValue)
        }
    }
    public var rawValue: String {
        switch self {
        case .default:
            return "default"
        case .name(let string):
            return string
        }
    }
}
